<?php
     /**************************************************************************************
     * Bookswapp is a web application which allow students to exchange their textbooks
     * It is developed by students of ITE "C. Colamonico" - Sistemi Informativi Aziendali
     * Acquaviva delle Fonti (BA) - Italy
     *
     * Bookswapp is free software; you can redistribute it and/or modify it under
     * the terms of the GNU Affero General Public License version 3 as published by the
     * Free Software Foundation
     *
     * Bookswapp is distributed in the hope that it will be useful, but WITHOUT
     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
     * FOR A PARTICULAR PURPOSE.  See the GNU Affero General Public License for more
     * details.
     *
     * You should have received a copy of the GNU Affero General Public License along 
     * with this program; if not, see http://www.gnu.org/licenses or write to the Free
     * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
     * 02110-1301 USA.
     *
     * You can contact ITE "C. Colamonico" with a mailing address at Via Colamonico, 5 
     * 70021 - Acquaviva delle Fonti (BA) Italy, or at email address bookswapp@itccolamonico.it.
     *
     * The interactive user interfaces in original and modified versions
     * of this program must display Appropriate Legal Notices, as required under
     * Section 5 of the GNU Affero General Public License version 3.
     *
     * In accordance with Section 7(b) of the GNU Affero General Public License version 3,
     * these Appropriate Legal Notices must retain the display of the Bookswapp
     * logo and ITE "C. Colamonico" copyright notice. If the display of the logo is not reasonably
     * feasible for technical reasons, the Appropriate Legal Notices must display the words
     * "Copyright ITE C. Colamonico - http://www.itccolamonico.it - 2014. All rights reserved".
     ****************************************************************************************/
?>
<?php
/* @var $this SchoolController */
/* @var $model School */
/* @var $form CActiveForm */
?>

<div class="form">


<?php $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
	'id' => 'school-form',
	'enableAjaxValidation' => true,
));
?>

	<p class="note">
		<?php echo Yii::t('app', 'Fields with'); ?> <span class="required">*</span> <?php echo Yii::t('app', 'are required'); ?>.
	</p>

	<?php echo $form->errorSummary($model); ?>

		<div class="row">
		<?php echo $form->labelEx($model,'name_school'); ?>
		<?php echo $form->textField($model, 'name_school', array('maxlength' => 200)); ?>
		<?php echo $form->error($model,'name_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'code_school'); ?>
		<?php echo $form->textField($model, 'code_school', array('maxlength' => 30)); ?>
		<?php echo $form->error($model,'code_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'order_school'); ?>
		<?php echo $form->textField($model, 'order_school', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'order_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'zip_school'); ?>
		<?php echo $form->textField($model, 'zip_school', array('maxlength' => 5)); ?>
		<?php echo $form->error($model,'zip_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'city_school'); ?>
		<?php echo $form->textField($model, 'city_school', array('maxlength' => 60)); ?>
		<?php echo $form->error($model,'city_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'district_school'); ?>
		<?php echo $form->textField($model, 'district_school', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'district_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'address_school'); ?>
		<?php echo $form->textField($model, 'address_school', array('maxlength' => 60)); ?>
		<?php echo $form->error($model,'address_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'phone1_school'); ?>
		<?php echo $form->textField($model, 'phone1_school', array('maxlength' => 20)); ?>
		<?php echo $form->error($model,'phone1_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'fax_school'); ?>
		<?php echo $form->textField($model, 'fax_school', array('maxlength' => 20)); ?>
		<?php echo $form->error($model,'fax_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'phone2_school'); ?>
		<?php echo $form->textField($model, 'phone2_school', array('maxlength' => 20)); ?>
		<?php echo $form->error($model,'phone2_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'email1_school'); ?>
		<?php echo $form->textField($model, 'email1_school', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'email1_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'email2_school'); ?>
		<?php echo $form->textField($model, 'email2_school', array('maxlength' => 45)); ?>
		<?php echo $form->error($model,'email2_school'); ?>
		</div><!-- row -->
		<div class="row">
		<?php echo $form->labelEx($model,'url_school'); ?>
		<?php echo $form->textField($model, 'url_school', array('maxlength' => 60)); ?>
		<?php echo $form->error($model,'url_school'); ?>
		</div><!-- row -->

		<label><?php echo GxHtml::encode($model->getRelationLabel('bswAdmins')); ?></label>
		<?php echo GxHtml::activeCheckBoxList($model, 'bswAdmins', GxHtml::encodeEx(GxHtml::listDataEx(Admin::model()->findAllAttributes(null, true)), false, true)); ?>
		<label><?php echo GxHtml::encode($model->getRelationLabel('classrooms')); ?></label>
		<?php echo GxHtml::activeCheckBoxList($model, 'classrooms', GxHtml::encodeEx(GxHtml::listDataEx(Classroom::model()->findAllAttributes(null, true)), false, true)); ?>

	<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
			'label'=>$model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Save'),
		)); 
                $this->endWidget();
                ?>
                
</div><!-- form -->